{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("remove")}-->
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除短消息</button>
<!--{/if}-->
{/block}


{block name="content"}
<div class="think-box-shadow">
    {include file='member/msg/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>收件人</th>
            <th class='text-left nowrap'>消息标题</th>
            <th class='text-left nowrap'>消息内容</th>
            <th class='text-left nowrap'>消息状态</th>
            <th class='text-left nowrap'>发送时间</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>
                <div class="inline-block sub-span-blue">
                    <div>帐号：<span>{$vo.username|default='--'}</span></div>
                    <div>昵称：<span>{$vo.nickname|default='--'}</span></div>
                </div>
            </td>
            <td class='text-left'>
                {$vo.title|default='--'}
            </td>

            <td class='text-left'>
                <!--{if auth("content_info")}-->
                    <a data-title="消息内容" class="layui-btn layui-btn-sm layui-btn-normal right" data-modal='{:url("content_info")}?id={$vo.id}'>消息内容</a>
                <!--{/if}-->
            </td>


            <td class='text-left'>
                {if isset($vo.status) and $vo.status eq 1}
                <!--{if auth("state")}-->
                <a class="layui-btn layui-btn-sm" data-action="{:url('state')}" data-confirm="点击后该会员将被封禁无法登陆，确定吗？" data-value="id#{$vo.id};status#0">正常</a>
                <!--{else}-->
                <a data-tips-text="您没有封禁会员的权限哦！" class="layui-btn layui-btn-sm layui-disabled">正常</a>
                <!--{/if}-->
                {else}
                <!--{if auth("state")}-->
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-confirm="确认解封该会员？" data-value="id#{$vo.id};status#1">隐藏</a>
                <!--{else}-->
                <a data-tips-text="您没有解封会员的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">隐藏</a>
                <!--{/if}-->
                {/if}

            </td>

            <td class='text-left'>{$vo.create_at|format_datetime}</td>
            <td class='text-left nowrap'>
                <div class="nowrap margin-bottom-5">

                    {if auth("remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                    {else}
                    <a data-tips-text="您没有操作权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
                    {/if}

                </div>


            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
